package com.corner.model.cornerservice.service;


import com.corner.model.cornerservice.domain.Info;
import com.corner.model.cornerservice.service.exception.BaseException;

import java.util.List;
import java.util.Map;

import retrofit.http.Body;
import retrofit.http.DELETE;
import retrofit.http.GET;
import retrofit.http.POST;
import retrofit.http.PUT;
import retrofit.http.Path;
import retrofit.http.Query;

public interface InfoService {
    @GET("/info/count")
    Map<String, Long> count()
            throws BaseException;

    @GET("/info/count")
    Map<String, Long> count(@Query("query") String query) throws BaseException;

    @GET("/info")
    List<Info> list()
            throws BaseException;

    @GET("/info")
    List<Info> list(@Query("query") String query) throws BaseException;

    @GET("/info/{objectId}")
    Info get(@Path("objectId") Long objectId) throws BaseException;

    /*
    * {
    *   code:407,
    *   message:ObjectNotFoud
    * }
    *
    */
    @GET("/info/{objectId}")
    Info get(@Path("objectId") Long objectId, @Query("query") String query) throws BaseException;

    @PUT("/info/{objectId}")
    Map<String, Object> update(@Path("objectId") Long objectId,
                               @Body Info info)
            throws BaseException;

    @DELETE("/info/{objectId}")
    Map<String, Object> delete(@Path("objectId") Long objectId) throws BaseException;

    @POST("/info")
    Map<String, Object> save(@Body Info info) throws BaseException;


}
